home *** CD-ROM | disk | FTP | other *** search
/ Mac Format 1995 June / MacFormat 25.iso / Shareware City / Developers / OutOfPhase1.1 Source / OutOfPhase Folder / ASTLoop.h < prev    next >
Text File  |  1994-07-17  |  1KB  |  53 lines

  1. /* ASTLoop.h */
  2.  
  3. #ifndef Included_ASTLoop_h
  4. #define Included_ASTLoop_h
  5.  
  6. /* ASTLoop module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* ASTExpression */
  12. /* TrashTracker */
  13. /* Memory */
  14. /* PcodeObject */
  15. /* CompilerRoot */
  16.  
  17. #include "PcodeObject.h"
  18. #include "CompilerRoot.h"
  19.  
  20. struct ASTLoopRec;
  21. typedef struct ASTLoopRec ASTLoopRec;
  22.  
  23. /* all memory allocated in this module is from TrashTracker */
  24.  
  25. typedef enum
  26.     {
  27.         eLoopWhileDo EXECUTE(= -32541),
  28.         eLoopUntilDo,
  29.         eLoopDoWhile,
  30.         eLoopDoUntil
  31.     } LoopTypes;
  32.  
  33. /* forwards */
  34. struct TrashTrackRec;
  35. struct ASTExpressionRec;
  36.  
  37. /* create a new loop node */
  38. ASTLoopRec*                    NewLoop(LoopTypes LoopType, struct ASTExpressionRec* ControlExpr,
  39.                                             struct ASTExpressionRec* BodyExpr,
  40.                                             struct TrashTrackRec* TrashTracker, long LineNumber);
  41.  
  42. /* type check the loop node.  this returns eCompileNoError if */
  43. /* everything is ok, and the appropriate type in *ResultingDataType. */
  44. CompileErrors                TypeCheckLoop(DataTypes* ResultingDataType,
  45.                                             ASTLoopRec* Loop, long* ErrorLineNumber,
  46.                                             struct TrashTrackRec* TrashTracker);
  47.  
  48. /* generate code for a loop. returns True if successful, or False if it fails. */
  49. MyBoolean                        CodeGenLoop(struct PcodeRec* FuncCode,
  50.                                             long* StackDepthParam, ASTLoopRec* Loop);
  51.  
  52. #endif
  53.